-- -*- coding: utf-8 -*-
-- API模块初始化文件

local api = {}

-- 导入所有子模块
local const = require("api.const")
local io_module = require("api.io")
local object = require("api.object")
local tool = require("api.tool")

-- 导出常量
api.ROUND_LIMIT = const.ROUND_LIMIT
api.COMMAND_FAIL_LIMIT = const.COMMAND_FAIL_LIMIT
api.INIT_RMB = const.INIT_RMB

-- 导出枚举
api.UnitType = const.UnitType
api.TildeType = const.TildeType
api.BuildingType = const.BuildingType
api.EntityType = const.EntityType
api.DirectionType = const.DirectionType
api.CommandType = const.CommandType
api.PlayerType = const.PlayerType

-- 导出配置
api.UNIT_CONFIG = const.UNIT_CONFIG
api.RESOURCE_CONFIG = const.RESOURCE_CONFIG
api.BUILDING_CONFIG = const.BUILDING_CONFIG

-- 导出常量工具函数
api.get_unit_config = const.get_unit_config
api.get_building_config = const.get_building_config
api.get_resource_config = const.get_resource_config
api.is_resource_tilde_type = const.is_resource_tilde_type

-- 导出IO函数
api.parse_input_state = io_module.parse_input_state
api.format_output_commands = io_module.format_output_commands
api.input = io_module.input
api.output = io_module.output

-- 导出对象类
api.GameBase = object.GameBase
api.PlayerModel = object.PlayerModel
api.TildeModel = object.TildeModel
api.GameState = object.GameState
api.GameStateModel = object.GameStateModel
api.UnitModel = object.UnitModel
api.BuildingModel = object.BuildingModel
api.CommandBase = object.CommandBase
api.MoveCommand = object.MoveCommand
api.AttackCommand = object.AttackCommand
api.BuildCommand = object.BuildCommand
api.SwapCommand = object.SwapCommand
api.HealCommand = object.HealCommand
api.CollectCommand = object.CollectCommand

-- 导出工具函数
api.calculate_distance = tool.calculate_distance
api.calculate_legal_distance = tool.calculate_legal_distance
api.is_in_range = tool.is_in_range
api.get_direction_to = tool.get_direction_to
api.is_valid_position = tool.is_valid_position
api.get_position_state = tool.get_position_state

-- 初始化函数
function api.init()
    -- API初始化函数
    -- 可以在这里进行一些初始化工作
end

return api
